import React, { Component } from 'react'
import history from '../history'

class CustomComponent extends Component {
  redirect(url, params) {
    const { router } = this.props
    const path = {
      pathname: url,
      state: params
    }
    history.push(path)
  }
  shouldComponentUpdate(nextProps, nextState) {
    return (JSON.stringify(nextProps) !== JSON.stringify(this.props)) || (JSON.stringify(nextState) !== JSON.stringify(this.state))
  }
}

export default CustomComponent
